<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head th:include="_meta :: header">
    <title>编辑</title>
</head>
<body>


<form action="#" class="layui-form layui-col-space5" id="form-draft-edit" method="post">
    <textarea style="margin: 20px;width: 500px;height: 300px;"  placeholder="请输入驳回理由" autocomplete="off" class="layui-input" id="reason" name="reason" type="text"></textarea>
    <input th:value="${id}" name="id" type="hidden" />
    <button  class="layui-btn layui-btn-normal" id="subbtn" type="submit" >
        确定
    </button>
</form>



<!--_footer 作为公共模版分离出去-->
<div th:replace="_footer :: footerjs"></div>
<div th:replace="_ueditor :: ueditor"></div>
<!--/_footer 作为公共模版分离出去-->
<!--请在下方写此页面业务相关的脚本-->
<script>
    layui.use(['form', 'layer','laydate'],function() {
        $ = layui.jquery;
        var form = layui.form,
            laydate = layui.laydate,
            layer = layui.layer;
        lay('.timeSpace').each(function(){
            laydate.render({
                elem: this
                ,trigger: 'click'
                ,type: 'datetime'
            });
        });
    });

    $(function () {
        $("#form-draft-edit").validate({
            rules: {
                reason: {
                    required: true,
                },
            },
            submitHandler:
                function (form) {
                    $(form).ajaxSubmit({
                        type: 'POST',
                        url: "/admin/audio/checkAudioFail",
                        success: function (data) {
                            console.log("数据"+data);
                            if (data.code == "1") {
                                selfmsg('驳回成功!', 1, function () {
                                    var index = parent.layer.getFrameIndex(window.name);
                                    parent.location.reload();
                                    parent.layer.close(index);
                                });
                            } else {
                                selfmsg('驳回失败!');
                            }
                        },
                        error: function () {
                            selfmsg('驳回异常!', 5);
                        }
                    });
                }
        })
    })
</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>